<%
Dim conn
Dim rs
Dim sqlcount
Dim getcount
F_ID = Request.Form.Item("F_ID")
F_RF_REC_ID = Request.Form.Item("F_RF_REC_ID")
F_PACK_CODE = Request.Form.Item("F_PACK_CODE")

F_ID = Replace(F_ID,"'","")
F_RF_REC_ID = Replace(F_RF_REC_ID,"'","")
F_PACK_CODE = Replace(F_PACK_CODE,"'","")
set conn = Server.Createobject("ADODB.Connection")
set  rs = Server.Createobject("ADODB.Recordset")
ConnStr = "DSN=dbpr_sql;UID=sa;PWD=hhhhhhhh;"
conn.Mode = 3
conn.Open (ConnStr)
sqlcount = "SELECT MAX() as numlines FROM REC_PACK"
set rs = conn.execute(sqlcount)
getcount = rs.fields("numlines")
Session("tablecount") = getcount
Session("Tablename") = Session("Tablename") 
Session("fieldname") = Session("fieldname")
SQL="INSERT INTO REC_PACK(ID,RF_REC_ID,PACK_CODE) VALUES(" & F_ID & "," & F_RF_REC_ID & "," & "'" & F_PACK_CODE & "'"  & ")"
set rs = conn.execute(SQL)
conn.close
set rs = Nothing
set conn = Nothing
Response.redirect("INS_REC_PACK1.asp")
%>
